package com.xqb.modules.domain.po;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.xqb.common.annotation.Excel;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.io.Serializable;
import java.util.Date;

/**
 * 学习记录对象 std_learning_record
 *
 * @author xqb
 * @date 2024-10-14
 */
@Data
@TableName("std_learning_record")
public class StdLearningRecord implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 学习记录的id
     */
    private Long id;

    /**
     * 对应课表的id
     */
    @Excel(name = "对应课表的id")
    private Long lessonId;

    /**
     * 对应小节的id
     */
    @Excel(name = "对应小节的id")
    private Long sectionId;

    /**
     * 用户id
     */
    @Excel(name = "用户id")
    private Long userId;

    /**
     * 视频的当前观看时间点，单位秒
     */
    @Excel(name = "视频的当前观看时间点，单位秒")
    private Long moment;

    /**
     * 是否完成学习，默认false
     */
    @Excel(name = "是否完成学习，默认false")
    private Integer finished;
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;
    /**
     * 完成学习的时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "完成学习的时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date finishTime;

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("lessonId", getLessonId())
                .append("sectionId", getSectionId())
                .append("userId", getUserId())
                .append("moment", getMoment())
                .append("finished", getFinished())
                .append("createTime", getCreateTime())
                .append("finishTime", getFinishTime())
                .append("updateTime", getUpdateTime())
                .toString();
    }
}
